package com.dyzs.util;


public class Pager {
	
	/** 分页大小 */
	public static final int PAGE_NUM=10;   
 	public int totalNum=0;
 	public int totalPage=0;
 	public int currentPage=1;
 	
 	
 	public Pager(){ 		
 		doTotalPage();		
 	}
 	
 	public Pager(int num,int currPage){
 		this.totalNum=num;
 		this.currentPage=currPage;
 		doTotalPage();		
 	}
 	
 	public void doTotalPage() {   
 		if (totalNum % PAGE_NUM == 0)
 			totalPage=totalNum / Constants.PAGE_NUM;
 		else
 			totalPage= totalNum / Constants.PAGE_NUM + 1;
 	}

 	public void doNextpage(){
 		currentPage++;
 	}
 	
 	
 	public void doProvepage(){
 		currentPage--;
 	}
	public int getTotalNum() {
		return totalNum;
	}

	public void setTotalNum(int totalNum) {
		this.totalNum = totalNum;
		doTotalPage();	
	}

	public int getCurrentPage() {
		return currentPage;
	}

	public void setCurrentPage(int currentPage) {
		this.currentPage = currentPage;
	}



	public void setTotalPage(int totalPage) {
		this.totalPage = totalPage;
	}

	public int getTotalPage() {
		return totalPage;
	} 
 	
 	
 	
 	
 	
 	
 

}
